<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>银行卡绑定</title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="js/lib/angular.min.js"></script>
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	 <style>
	 	body{
			font-size:12px;
		}
	 	/* table,
	 				th,
	 				td {
	 					border: 1px solid grey;
	 					border-collapse: collapse;
	 					padding: 5px;
	 					vertical-align: middle !important;
	 				}	 */	
		table td:nth-child(even) {
			
		}
		table tr:nth-child(2) {
			background-color:#f1f1f1;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	 </style>
	<body ng-app="myApp" ng-controller="customersCtrl">
		<div class="" id="box">
				<div class="">
		<!--加载动画-->
		<div class="wrapper">
            <div id="loader-wrapper">
                <div id="loader"></div>
            </div>
        </div>
			<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">				
				<tbody>
					<tr>
						<th colspan="12" style="font-size:26px;color:#337ab7">绑定银行卡:&nbsp;&nbsp;&nbsp;&nbsp;</th>
					</tr>
					<tr>
						<td>真实姓名：</td>
						<td colspan="12">
						<input id="p1" ng-model="p1"  type="text" class="form-control" style="width:280px;" placeholder="请输入真实姓名"/>					
						</td>											
					</tr>					
					<tr>
						<td>身份证号码：</td>
						<td colspan="12">
							<input id="p2" ng-model="p2" placeholder="请输入身份证号码" class="form-control" type="text" style="width:280px;" />							
						</td>	
					</tr>
					<tr>
						<td>银行卡号码：</td>
						<td colspan="12">
							<input id="p3" ng-model="p3" placeholder="请输入银行卡号" class="form-control" type="text" style="width:280px;" />
						</td>	
					</tr>
					<tr>
						<td>手机号码：</td>
						<td colspan="12">
							<input id="p4" ng-model="p4" placeholder="请输入银行预留号码" class="form-control" type="text" style="width:280px;" />			 
						</td>	
					</tr>
						<td colspan="12">
							<input id="btn" type="btn" ng-click="xia()" value="绑定银行卡" class="btn btn-danger" style="display:block;margin:0 210px;"/>
						</td>
					</tr>					
				</tbody>
			</table>					
			</div>
			</div>								
		</div>
	</body>
	<script>
		
	</script>
	<script>		
		var app = angular.module('myApp', []);
        app.controller('customersCtrl', function($scope, $http){
        	/*根据登陆信息获取token*/			
				$scope.xia = function(){
				var token = sessionStorage.getItem(key=1)
				var p1 = document.getElementById("p1").value;
				var p2 = document.getElementById("p2").value;
				var p3 = document.getElementById("p3").value;
				var p4 = document.getElementById("p4").value;
					$http({
							method:'POST',
							params:{
								realname:p1,
								idcard:p2,
								bankcard:p3,
								mobile:p4
								/*realname:"罗勇",
								idcard:"411328198711250011",
								bankcard:"6212261714006233899",
								mobile:"18520149705"*/
							},
							url: window.baseUrl+"user/bank/add/"+token
						}).then(function successCallback(data){
							console.log("请求交易明细数据成功...")
							console.log(data.data)
							alert(data.data.resp_message)
							
						}, function errorCallback(data){
								alert("请求数据失败...")
						     	console.log(data)
						})	
				}
        })
	</script>
</html>

